package com.yunshipei.utils;

import com.yunshipei.db.green.AppStatistics;
import com.yunshipei.db.green.AppStatisticsDao;
import com.yunshipei.manager.EnterDbManager;
import com.yunshipei.model.PointModel;
import com.yunshipei.model.UserInfo;

public class LogHandlerUtils {

    public static void savePoint(final PointModel pointModel) {
        ThreadUtils.getSinglePool().execute(new Runnable() {
            @Override
            public void run() {
                UserInfo userInfo = pointModel.getUserInfo();
                AppStatisticsDao dao = EnterDbManager.getInstances().getAppStatisticsDao();
                AppStatistics appStatistics = new AppStatistics(userInfo.getUuid(), pointModel.getUrl(), pointModel.getAppId(), pointModel.getTitle(), userInfo.getCompanyId(), System.currentTimeMillis(), userInfo.getDepartmentId());
                dao.insert(appStatistics);
            }
        });
    }
}
